<?php
/**
 * Created by PhpStorm.
 * User: andyge
 * Date: 15/11/8
 * Time: 上午8:43
 */

class Login
{
    function check_logined() {
        session_start();
        if(!isset($_SESSION['user'])) {
            header("location:login.php?logintip=请先登陆.");
        }
    }

    function get_login_user() {
        session_start();
        if(isset($_SESSION['user'])) {
            return $_SESSION['user'];
        }
    }

    function set_login_user($user) {
        session_start();
        $_SESSION['user'] = $user;
    }
}
?>